﻿using System;
using System.Web.Mvc;
using Autofac;
using Autofac.Integration.Mvc;

namespace Inovout.Web.Mvc
{
    public class UnhandledExceptionFilter : BaseUnhandledExceptionFilter, IExceptionFilter
    {

        public void OnException(System.Web.Mvc.ExceptionContext filterContext)
        {
            var exceptionContext = AutofacDependencyResolver.Current.RequestLifetimeScope.Resolve<ExceptionContext>();
            exceptionContext.Exceptions = new Exception[] { filterContext.Exception };
            base.OnException(exceptionContext);
        }
    }
}
